﻿namespace VehicleRental.API.Models
{
    using System.Runtime.Serialization;
using VehicleRental.Models;

    [DataContract]
    public class PlaceCreatedModel
    {
        [DataMember(Name="title")]
        public string Title { get; set; } // Name ??

        [DataMember(Name = "longitude")]
        public decimal Longitude { get; set; }

        [DataMember(Name = "latitude")]
        public decimal Latitude { get; set; }

        [DataMember(Name = "address")]
        public string Address { get; set; }

        [DataMember(Name = "description")]
        public string Description { get; set; } // UI purpose ??

        [DataMember(Name = "imageSource")]
        public string ImageSource { get; set; } // UI purpose ??

        public static PlaceCreatedModel Parse(Place currentPlace)
        {
            return new PlaceCreatedModel()
            {
                Title = currentPlace.Title,
                Address = currentPlace.Address,
                Description = currentPlace.Description,
                ImageSource = currentPlace.ImageSource,
                Latitude = currentPlace.Latitude,
                Longitude = currentPlace.Longitude
            };
        }
    }
}